The present invention relates to a buffer memory or cache memory, and more particularly to a way of judging the presence or absence of necessary data and dealing with the information on validity of the data.
A cache memory of this type has been disclosed in Japanese Unexamined Patent Publications Nos. 58-68286 and 58-68287 laid open in public on Apr. 23, 1983 and claiming a Priority right of West German Patent application filed on Sept. 30, 1981.
A buffer memory or cache memory copies and retains a portion of the contents of a main memory. When a data processing device requests data in the main memory, the buffer memory is first searched. If the data is present in the buffer memory, the data in the buffer memory is used without accessing the main memory. The main memory is accessed only when the data is not present in the buffer memory. In the above operation, a hit judgement, i.e., a judgement whether necessary data is present, i.e., a hit, is made wherein a certain time. In the case of a miss judgement, the activation of an access operation to the main memory is correspondingly delayed so that the processing speed lowers.
According to one of the control methods for a buffer memory, a validity flag is set for each data portion, e.g., each byte in the buffer memory. The validity flag indicates whether the contents of the data portion coincide with the corresponding data in the main memory. For instance, when the contents of some data portion in the main memory are updated for example by writing data in the main memory with an associated device in the system (e.g., I/0 devices) and if the old data which was stored in the corresponding location of the main memory has been copied to the buffer memory, then the contents of the corresponding validity flag are changed to indicate "invalid", i.e., to indicate that there was a renewal of data in the main memory, thus preventing processing of the old data.
With such a method, a check of a validity flag is unavoidable for a hit judgement. It is therefore desirable to shorten the check time for a validity flag so that a hit judgement on the cache memory is conducted at a high speed.